<template>
	<view class="content">
		<u-navbar title="加盟查询" :placeholder="true" bgColor="rgba(0,0,0,0.0)" :autoBack="true">
		</u-navbar>
		<view class="search-box">
			<view class="search"><u-search :showAction="false" bgColor="rgba(0,0,0,0.0)" @change="list = []" placeholder="搜索公司名称" v-model="keyword"></u-search></view>
			<view>
				<u-button type="primary" color="linear-gradient(269deg, #5755F2 0%, #CC7BFF 100%)" @click="gosearch" shape="circle" size="mini" text="搜索"></u-button>
			</view>
		</view>
		<view class="list" v-for="(item,index) in list" :key="index">
			<view class="title">
				企业名称：{{item.name}}
			</view>
			<view class="title1">
				服务范围：{{item.service_info}}
			</view>
			<view class="title1">
				营业执照： <text @click="goeve(item.business_license)">点击查看</text>
			</view>
			<view class="title1">
				合作日期：{{item.end_time}}
			</view>
		</view>
		<view v-if="list.length < 1">
			<view class="image">
				<image src="https://m.lqvvvv.com/assets/static/my/inquiry-bg.png" mode=""></image>
			</view>
			<view class="tisp">
				合作提示:您需要自行判断合作伙伴提供的相应服务，如需选择与合作伙伴 进行交易，请核实合作伙伴资质，信誉、能力，知晓服务具体内容、收费标准，服务期限，违约责任等需要交易条款，谨慎交易!旅趣不对合作伙伴服务的安全性，准确性，有效性等承担任何担保或承诺<br>投诉举报邮箱：372328298@qq.com。
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				keyword: '',
				list:[]
			}
		},
		methods:{
			goeve(image){
				let img = []
				img.push('https://m.lqvvvv.com' + image)
				uni.previewImage({
					urls: img,
					current: 0
				});
			},
			gosearch(){
				if(this.keyword == ''){
					uni.showToast({
						title:'公司名称不能为空!',
						icon:'none'
					})
					return
				}
				let params = {
					keyword:this.keyword
				}
				this.$Request({
					method: 'POST',
					url: '/api/index/getPartnerList',
					data: params,
					ismsg: false,
				}).then(res => {
					if (res.code == 1) {
						if(res.data.data.length < 1){
							uni.showToast({
								title:'搜索结果为空！',
								icon:'none'
							})
						}
						this.list = res.data.data
					}
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	.content{
		min-height: 100vh;
		background-image: url('https://m.lqvvvv.com/assets/static/index/nav-bg.png'); 
		background-repeat: no-repeat;
		background-size: 100% 800rpx;
		padding: 30rpx;
		background-color: #ECF1FF;
		.search-box{
			background: rgba(255,255,255,0.4);
			border-radius: 34rpx;
			border: 1rpx solid #FFFFFF;
			padding: 5rpx 20rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			.search{
				width: 90%;
			}
		}
		.list{
			padding: 30rpx;
			background-color: #ffffff;
			margin-top: 30rpx;
			border-radius: 20rpx;
			.title{
				font-size: 28rpx;
				font-weight: 900;
			}
			.title1{
				font-size: 26rpx;
				font-weight: 500;
				color: #666;
				margin-top: 10rpx;
				text{
					color: #5755F2;
				}
			}
		}
		.image{
			width: 563rpx;
			margin:  0 auto;
			margin-top: 100rpx;
			image{
				width: 563rpx;
				height: 360rpx;
			}
		}
		.tisp{
			padding: 20rpx;
			background: #ECF1FF;
			border-radius: 13rpx;
			font-weight: 400;
			font-size: 26rpx;
			color: #8B8DA0;
			line-height: 140%;
			text-align: center;
			
		}
	}
</style>